﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class VisaTypeController
    {
        public int InsertVisaType(VisaTypeInfo info)
        {
            return SQL.InsertVisaType(info.VisaTypeName, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void UpdateVisaType(VisaTypeInfo info)
        {
            SQL.UpdateVisaType(info.VisaTypeId, info.VisaTypeName, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void DeleteVisaType(VisaTypeInfo info)
        {
            DeleteVisaType(info.VisaTypeId);
        }
        public void DeleteVisaType(int visaTypeId)
        {
            SQL.DeleteVisaType(visaTypeId);
        }
        public VisaTypeInfo GetVisaType(int visaTypeId)
        {
            return CBO.FillObject<VisaTypeInfo>(SQL.GetVisaType(visaTypeId));
        }
        public List<VisaTypeInfo> ListVisaType()
        {
            return CBO.FillCollection<VisaTypeInfo>(SQL.ListVisaType());
        }
        public DataTable SelectVisaType()
        {
            return CBO.ConvertToDataTable(ListVisaType(), typeof(VisaTypeInfo));
        }
        public Dictionary<object, object> ListVisaTypeLookup()
        {
            var visas = ListVisaType();
            var dicusers = new Dictionary<object, object>();
            foreach (VisaTypeInfo info in visas)
                dicusers.Add(info.VisaTypeId, info.VisaTypeName);

            return dicusers;
        }

    }
}
